package xyz.xiezc.spider.common.annotation;

import xyz.xiezc.ioc.annotation.Component;
import xyz.xiezc.ioc.common.AnnotationHandler;
import xyz.xiezc.ioc.common.BeanDefine;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wb-xzc291800
 * @date 2019/04/04 16:17
 */
@Component
public class MatchBeanAnnotationHandler implements AnnotationHandler<MatchBean> {

    /**
     * 装载注解的爬取实例的描述信息,  这里有优化空间, 可以把经常命中的对象移到前面去
     */
    public List<InstanceDefine> instanceDefineList = new ArrayList<>();

    @Override
    public Class<MatchBean> getHandlerAnnotation() {
        return MatchBean.class;
    }

    @Override
    public void process(Class<?> aClass, MatchBean matchBean, List<BeanDefine> beanDefines) {
        instanceDefineList.add(new InstanceDefine(aClass, matchBean));
    }


}
